package com.itic.mall.mobile.jpush;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.itic.appbase.framework.type.AlertType;
import com.itic.mall.mobile.base.BaseMobileInterface;
import com.itic.mall.mobile.msg.vo.MsgVO;
import com.itic.mall.system.msg.apppush.service.AppPushService;
import com.itic.mall.system.users.usersmall.persistence.model.UsersMall;
@Controller
@RequestMapping(value = "/mobile/jpush")
public class JPushInterface extends BaseMobileInterface{
	
	@Autowired
	private AppPushService appPushService;
	@RequestMapping(value="push")
	@ResponseBody
	public Map<String, Object> push(String userId){
		
		UsersMall user = this.usersMallService.get(userId);
		MsgVO msgVO = new MsgVO();
		msgVO.setMoney(100.00);
		this.appPushService.pushMsg(user, AlertType.pre, null, msgVO);
		Map<String, Object> result  = new HashMap<>();
		result.put(DATA,SUCCESS);
		return result;
	}
	
	
}
